package smedi.ismedi.web.bff.controller.inmail;

import com.smedi.ismedi.inmail.api.dto.request.LoginLogUserStaticsPageRequest;
import com.smedi.ismedi.inmail.api.dto.response.LoginLogUserStaticsResponse;
import com.smedi.ismedi.inmail.api.feign.RemoteLoginLogUserStaticsFeignApi;
import com.smedi.ismedi.web.starter.common.PaginationData;
import com.smedi.ismedi.web.starter.common.ResponseData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 通知公告Controller
 *
 * @author jiangqinxuan
 * @date 2021/07/26
 */
@Slf4j
@Api(value = "登录统计-用户" , tags = {"登录统计-用户"})
@RequestMapping(value = "/webbff/v1/login-log-user-statics" )
@RestController
@RequiredArgsConstructor
public class LoginLogUserStaticsController {
    private final RemoteLoginLogUserStaticsFeignApi remoteLoginLogUserStaticsFeignApi;

    /**
     * 登录统计 分页 （用户维度）
     *
     * @return ResponseData<Boolean>
     */
    @ApiOperation(httpMethod = "POST" , value = "登录统计 分页 （用户维度）" )
    @PostMapping(value = "/page" )
    ResponseData<PaginationData<LoginLogUserStaticsResponse>> page(@Validated @RequestBody LoginLogUserStaticsPageRequest loginLogUserStaticsPageRequest) {
        return remoteLoginLogUserStaticsFeignApi.page(loginLogUserStaticsPageRequest);
    }
}
